<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div
    fxLayout="row"
    fxFlex="100"
    fxLayoutAlign="start center"
    class="filter-section"
>
    <div
        fxFlex="50"
        fxLayout="row"
        fxLayoutAlign="start center"
        fxLayoutGap="10px"
    >
        <div
            class="filter-header"
            fxLayout="row"
            fxLayoutAlign="start center"
            fxFlex="100"
        >
            <div
                fxLayoutAlign="center center"
                class="active-filters mr-5"
                *ngIf="activeFilters.selectedLabels.length > 0"
            >
                <i class="material-icons fs-icon">filter_alt</i>
            </div>
            <span>Labels</span>
        </div>
    </div>
    <div
        fxFlex="50"
        class="filter-selection"
        fxLayout="column"
        (click)="$event.stopPropagation()"
        fxLayoutAlign="end center"
    >
        <mat-form-field
            appearance="outline"
            class="form-field-small filter-selection"
            color="accent"
        >
            <mat-select
                multiple
                [compareWith]="compare"
                [(ngModel)]="activeFilters.selectedLabels"
            >
                <mat-option
                    *ngFor="let label of labels; let i = index"
                    [value]="label"
                    class="smaller-font-size"
                >
                    <sp-label
                        [labelText]="label.label"
                        size="medium"
                        [labelBackground]="label.color"
                    >
                    </sp-label>
                </mat-option>
            </mat-select>
        </mat-form-field>
    </div>
</div>
